home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games 1996 July / Amiga Games 1996 #7.iso / archive / userbox / publicdomain / muispell.lha / MUISpell / Source / Gui.c < prev    next >
C/C++ Source or Header  |  1996-03-28  |  19KB  |  537 lines

  1. /***************************************************************************
  2. *                                                                                                    *
  3. *    MUISpell                                                                                    *
  4. *    Spellchecking without texteditor, requires AlphaSpell and MUI            *
  5. *    Copyright (C) 1996  Dirk Holtwick                                                    *
  6. *                                                                                                    *
  7. *    This program is free software; you can redistribute it and/or modify    *
  8. *    it under the terms of the GNU General Public License as published by    *
  9. *    the Free Software Foundation; either version 2 of the License, or        *
  10. *    (at your option) any later version.                                                *
  11. *                                                                                                    *
  12. *    This program is distributed in the hope that it will be useful,            *
  13. *    but WITHOUT ANY WARRANTY; without even the implied warranty of            *
  14. *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
  15. *    GNU General Public License for more details.                                    *
  16. *                                                                                                    *
  17. *    You should have received a copy of the GNU General Public License        *
  18. *    along with this program; if not, write to the Free Software                *
  19. *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                    *
  20. *                                                                                                    *
  21. *      Author:   Dirk Holtwick                                                                *
  22. *                    Karlstr. 59                                                                    *
  23. *                    47119 Duisburg                                                                *
  24. *                    GERMANY                                                                        *
  25. *                    dirco@uni-duisburg.de                                                    *
  26. *                                                                                                    *
  27. ****************************************************************************/
  28.  
  29. // The first source has been genereate with MUIBuilder, but then I had 
  30. //   some problems with it and startet to change things by hand. 
  31. //   But anyway MUIBuilder is a fantastic program!
  32.  
  33. #ifndef MAKE_ID
  34. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  35. #endif
  36.  
  37. #ifdef _DCC
  38. #define __inline
  39. #endif
  40.  
  41. enum{
  42.     p_,
  43.     p_ram,
  44.     p_backward,
  45.     p_forward,
  46.     p_path,
  47.     p_dict,
  48.     p_keyfile,
  49.     p_rate,
  50.     p_user,
  51.     p_buffer,
  52.     p_command
  53. };
  54.  
  55. #include <clib/asl_protos.h>
  56.  
  57. #include "Gui.h"
  58. #include "GuiExtern.h"
  59. #include "Cat.h"
  60. #include <clib/gadtools_protos.h>
  61.  
  62. #define Barlabel MUIA_Family_Child,MenuitemObject,MUIA_Menuitem_Title,NM_BARLABEL,End
  63.  
  64. extern STRPTR GetMUISpellString(LONG);
  65.  
  66. static char *GetMBString(int ref)
  67. {
  68.     char *aux;
  69.  
  70.     aux = GetMUISpellString(ref);
  71.     if (aux[1] == '\0') return(&aux[2]);
  72.     else                return(aux);
  73. }
  74.  
  75. struct ObjApp * CreateApp(void)
  76. {
  77.     struct ObjApp * Object;
  78.  
  79.     APTR    MNlabel0Projekt, MNlabel0Laden, MNlabel0Speichern, MNlabel0Speichernals;
  80.     APTR    MNlabel0Voreinstellungen, menspellHilfe, MNlabel0Info, MNlabel0Ende;
  81.     APTR    gr_view, gr_prefs, gr_prefs_2, la_back, la_forward;
  82.     APTR    GR_grp_5, la_path, la_books, la_keyfile, la_rate, GR_grp_3;
  83.     APTR    la_user, la_buffer, la_command;
  84.  
  85.     static const struct Hook do_learnHook = { { NULL,NULL },(VOID *)do_learn,NULL,NULL };
  86.     static const struct Hook do_goonHook = { { NULL,NULL },(VOID *)do_goon,NULL,NULL };
  87.     static const struct Hook do_backHook = { { NULL,NULL },(VOID *)do_back,NULL,NULL };
  88.     static const struct Hook do_lvacceptHook = { { NULL,NULL },(VOID *)do_lvaccept,NULL,NULL };
  89.     static const struct Hook do_loadHook = { { NULL,NULL },(VOID *)do_load,NULL,NULL };
  90.     static const struct Hook do_saveHook = { { NULL,NULL },(VOID *)do_save,NULL,NULL };
  91.     static const struct Hook do_saveasHook = { { NULL,NULL },(VOID *)do_saveas,NULL,NULL };
  92.     static const struct Hook do_guessHook = { { NULL,NULL },(VOID *)do_guess,NULL,NULL };
  93.     static const struct Hook do_acceptHook = { { NULL,NULL },(VOID *)do_accept,NULL,NULL };
  94.     static const struct Hook do_save_prefsHook = { { NULL,NULL },(VOID *)do_save_prefs,NULL,NULL };
  95.     static const struct Hook do_use_prefsHook = { { NULL,NULL },(VOID *)do_use_prefs,NULL,NULL };
  96.     static const struct Hook do_cancel_prefsHook = { { NULL,NULL },(VOID *)do_cancel_prefs,NULL,NULL };
  97.     static const struct Hook do_ignoreHook = { { NULL,NULL },(VOID *)do_ignore,NULL,NULL };
  98.     static const struct Hook do_editdistHook = { { NULL,NULL },(VOID *)do_editdist,NULL,NULL };
  99.     static const struct Hook do_booksHook = { { NULL,NULL },(VOID *)do_books,NULL,NULL };
  100.     static const struct Hook do_bookstartHook = { { NULL,NULL },(VOID *)do_bookstart,NULL,NULL };
  101.     static const struct Hook do_drawerHook = { { NULL,NULL },(VOID *)do_drawer,NULL,NULL };
  102.     static const struct Hook do_lineHook = { { NULL,NULL },(VOID *)do_line,NULL,NULL };
  103.     static const struct Hook do_popupHook = { { NULL,NULL },(VOID *)do_popup,NULL,NULL };
  104.  
  105.     if (!(Object = AllocVec(sizeof(struct ObjApp), MEMF_PUBLIC|MEMF_CLEAR)))
  106.         return(NULL);
  107.  
  108.     Object->STR_txt_view = NULL;
  109.  
  110.     Object->cy_ramContent[0] = GetMBString(m_cy_ram0);
  111.     Object->cy_ramContent[1] = GetMBString(m_cy_ram1);
  112.     Object->cy_ramContent[2] = GetMBString(m_cy_ram2);
  113.     Object->cy_ramContent[3] = GetMBString(m_cy_ram3);
  114.     Object->cy_ramContent[4] = NULL;
  115.  
  116.     Object->cy_lineContent[0] = GetMBString(m_cy_line0);
  117.     Object->cy_lineContent[1] = GetMBString(m_cy_line1);
  118.     Object->cy_lineContent[2] = NULL;
  119.  
  120.     Object->win_view = WindowObject,
  121.         MUIA_Window_Title, "MUISpell 1.1 © Dirk Holtwick 1995",
  122.         MUIA_Window_ID, MAKE_ID('1', 'W', 'I', 'N'),
  123.         WindowContents, gr_view = GroupObject,
  124.             Child, HGroup,
  125.                 Child, Object->bt_tback = SimpleButton(GetMBString(m_bt_back)),
  126.                 Child, Object->pa_spell = PopobjectObject,
  127.                     MUIA_Weight, 1000,
  128.                     MUIA_Popobject_WindowHook, &do_popupHook,
  129.                     MUIA_Popstring_String, Object->str_spell = StringObject,
  130.                         MUIA_ControlChar, ' ',
  131.                         MUIA_Frame, MUIV_Frame_String,
  132.                         MUIA_String_Format, MUIV_String_Format_Center,
  133.                         MUIA_ShortHelp, "Geben sie für das fehlerhafte\nWort die Korrektur an.",
  134.                         End,
  135.                     MUIA_Popstring_Button, PopButton(MUII_PopUp),
  136.                     MUIA_Popobject_Object, Object->lv_spell = ListviewObject,
  137.                         MUIA_Listview_DoubleClick, TRUE,
  138.                         MUIA_Listview_List, ListObject,
  139.                             MUIA_Frame, MUIV_Frame_InputList,
  140.                             MUIA_List_Format, "P=\033c",
  141.                             End,
  142.                         End,
  143.                     End,
  144.                 Child, Object->bt_tskip = SimpleButton(GetMBString(m_bt_skip)),
  145.                 End,
  146.             Child, Object->lv_view = ListviewObject,
  147.                 MUIA_Listview_Input, FALSE,
  148.                 MUIA_Listview_List, FloattextObject,
  149.                     MUIA_Frame, MUIV_Frame_ReadList,
  150.                     End,
  151.                 End,
  152.             Child, Object->gauge_txt=GaugeObject,
  153.                 GaugeFrame,
  154.                 MUIA_Gauge_Horiz, TRUE,
  155.                 MUIA_Gauge_Current, 0,
  156.                 MUIA_FixHeightTxt, "X",
  157.                 End,
  158.             Child, HGroup,
  159.                 MUIA_Group_SameSize, TRUE,
  160.                 Child, Object->bt_learn = SimpleButton(GetMBString(m_bt_learn)),
  161.                 Child, Object->bt_guess = SimpleButton(GetMBString(m_bt_guess)),
  162.                 Child, Object->cy_line = CycleObject,
  163.                     MUIA_ControlChar, '/',
  164.                     MUIA_Cycle_Entries, Object->cy_lineContent,
  165.                     MUIA_ShortHelp, "Wollen sie nur ein Wort\noder eine ganze Zeile\nkorrigieren?",
  166.                     End,
  167.                 Child, Object->bt_accept = SimpleButton(GetMBString(m_bt_accept)),
  168.                 Child, Object->bt_ignore = SimpleButton(GetMBString(m_bt_ignore)),
  169.                 End,
  170.             End,
  171.         End;
  172.  
  173.     Object->cy_ram = CycleObject,
  174.         MUIA_ExportID, p_ram,
  175.         MUIA_Cycle_Entries, Object->cy_ramContent,
  176.         MUIA_ShortHelp, "Sollen die Wörterbücher und\ndas Programm in die RAM Disk\numgelagert werden?",
  177.     End;
  178.  
  179.     Object->sl_back = SliderObject,
  180.         MUIA_ExportID, p_backward,
  181.         MUIA_Slider_Min, 1,
  182.         MUIA_Slider_Max, 50,
  183.         MUIA_Slider_Level, 5,
  184.         MUIA_ShortHelp, "Wieviele Zeilen sollen vor\ndem fehlerhaften Wort\nangezeigt werden?",
  185.     End;
  186.  
  187.     la_back = LLabel(GetMBString(m_la_back));
  188.  
  189.     Object->sl_forward = SliderObject,
  190.         MUIA_ExportID, p_forward,
  191.         MUIA_Slider_Min, 1,
  192.         MUIA_Slider_Max, 50,
  193.         MUIA_Slider_Level, 5,
  194.         MUIA_ShortHelp, "Wieviele Zeilen sollen hinter\ndem fehlerhaften Wort\nangezeigt werden?",
  195.     End;
  196.  
  197.     la_forward = LLabel(GetMBString(m_la_forward));
  198.     la_buffer = LLabel(GetMBString(m_la_buffer));
  199.  
  200.     Object->sl_buffer = SliderObject,
  201.         MUIA_ExportID, p_buffer,
  202.         MUIA_Slider_Min, 5,
  203.         MUIA_Slider_Max, 99,
  204.         MUIA_Slider_Level, 20,
  205.         MUIA_ShortHelp, "Wieviel Prozent zu der Textlänge\nsollen als Arbeitsspeicher\nreserviert werden?",
  206.     End;
  207.  
  208.     gr_prefs_2 = GroupObject,
  209.         MUIA_Background, MUII_GroupBack,
  210.         MUIA_Frame, MUIV_Frame_Group,
  211.         MUIA_FrameTitle, GetMBString(m_gr_prefs_2Title),
  212.         MUIA_Group_Columns, 2,
  213.         Child, la_back,
  214.         Child, Object->sl_back,
  215.         Child, la_forward,
  216.         Child, Object->sl_forward,
  217.         Child, la_buffer,
  218.         Child, Object->sl_buffer,
  219.     End;
  220.  
  221.     la_path = LLabel(GetMBString(m_la_path));
  222.  
  223.     Object->str_drawer = StringObject,
  224.         MUIA_ExportID, p_path,
  225.         MUIA_Frame, MUIV_Frame_String,
  226.         MUIA_String_Contents, "work:dictionary/",
  227.         MUIA_ShortHelp, "In welchem Verzeichnis\nbefinden sich ihre\nWörterbücher?",
  228.     End;
  229.  
  230.     Object->pa_drawer = PopaslObject,
  231.         MUIA_Popstring_String, Object->str_drawer,
  232.         MUIA_Popstring_Button, PopButton(MUII_PopDrawer),
  233.         ASLFR_DrawersOnly, TRUE,
  234.     End;
  235.  
  236.     la_books = LLabel(GetMBString(m_la_books));
  237.  
  238.     Object->str_books = StringObject,
  239.         MUIA_ExportID, p_dict,
  240.         MUIA_Frame, MUIV_Frame_String,
  241.         MUIA_String_Contents, "*.low *.mix",
  242.         MUIA_String_MaxLen, 200,
  243.     End;
  244.  
  245.     Object->pa_books = PopaslObject,
  246.         MUIA_Popasl_StopHook, &do_booksHook,
  247.         MUIA_Popasl_StartHook, &do_bookstartHook,
  248.         MUIA_Popstring_String, Object->str_books,
  249.         MUIA_Popstring_Button, PopButton(MUII_PopFile),
  250.         ASLFR_DoMultiSelect, TRUE,
  251.         ASLFR_InitialFile, "",
  252.         ASLFR_DoPatterns, TRUE,
  253.         ASLFR_InitialPattern,"#?.(mix|low)",
  254.     End;
  255.  
  256.     la_user = LLabel(GetMBString(m_la_user));
  257.  
  258.     Object->str_user = StringObject,
  259.         MUIA_ExportID, p_user,
  260.         MUIA_Frame, MUIV_Frame_String,
  261.         MUIA_String_Contents, "User",
  262.         MUIA_String_MaxLen, 200,
  263.     End;
  264.  
  265.     la_keyfile = LLabel(GetMBString(m_la_keyfile));
  266.  
  267.     Object->str_keyfile = StringObject,
  268.         MUIA_ExportID, p_keyfile,
  269.         MUIA_Frame, MUIV_Frame_String,
  270.         MUIA_String_Contents, "S:Alpha-Key",
  271.         MUIA_String_MaxLen, 80,
  272.     End;
  273.  
  274.     Object->pa_keyfile = PopaslObject,
  275.         MUIA_Popstring_String, Object->str_keyfile,
  276.         MUIA_Popstring_Button, PopButton(MUII_PopFile),
  277.     End;
  278.  
  279.     la_command = LLabel("AlphaSpell");
  280.  
  281.     Object->str_command = StringObject,
  282.         MUIA_ExportID, p_command,
  283.         MUIA_Frame, MUIV_Frame_String,
  284.         MUIA_String_Contents, "C:ASpell",
  285.         MUIA_String_MaxLen, 80,
  286.     End;
  287.  
  288.     Object->pa_command = PopaslObject,
  289.         MUIA_Popstring_String, Object->str_command,
  290.         MUIA_Popstring_Button, PopButton(MUII_PopFile),
  291.     End;
  292.  
  293.     la_rate = LLabel(GetMBString(m_la_rate));
  294.  
  295.     Object->sl_rate = SliderObject,
  296.         MUIA_ExportID, p_rate,
  297.         MUIA_Slider_Min, 0,
  298.         MUIA_Slider_Max, 20,
  299.         MUIA_Slider_Level, 2,
  300.     End;
  301.  
  302.     GR_grp_5 = GroupObject,
  303.         MUIA_Background, MUII_GroupBack,
  304.         MUIA_Frame, MUIV_Frame_Group,
  305.         MUIA_FrameTitle, GetMBString(m_GR_grp_5Title),
  306.         MUIA_Group_Columns, 2,
  307.         Child, la_path,
  308.         Child, Object->pa_drawer,
  309.         Child, la_books,
  310.         Child, Object->pa_books,
  311.         Child, la_user,
  312.         Child, Object->str_user,
  313.         Child, la_command,
  314.         Child, Object->pa_command,
  315.         Child, la_keyfile,
  316.         Child, Object->pa_keyfile,
  317.         Child, la_rate,
  318.         Child, Object->sl_rate,
  319.     End;
  320.  
  321.     Object->bt_save_prefs = SimpleButton(GetMBString(m_bt_save_prefs));
  322.     Object->bt_use_prefs = SimpleButton(GetMBString(m_bt_use_prefs));
  323.     Object->bt_cancel_prefs = SimpleButton(GetMBString(m_bt_cancel_prefs));
  324.  
  325.     GR_grp_3 = GroupObject,
  326.         MUIA_Group_Horiz, TRUE,
  327.         MUIA_Group_SameSize, TRUE,
  328.         Child, Object->bt_save_prefs,
  329.         Child, Object->bt_use_prefs,
  330.         Child, Object->bt_cancel_prefs,
  331.     End;
  332.  
  333.     gr_prefs = GroupObject,
  334.         Child, Object->cy_ram,
  335.         Child, gr_prefs_2,
  336.         Child, GR_grp_5,
  337.         Child, GR_grp_3,
  338.     End;
  339.  
  340.     Object->win_prefs = WindowObject,
  341.         MUIA_Window_Title, GetMBString(m_win_prefs),
  342.         MUIA_Window_ID, MAKE_ID('2', 'W', 'I', 'N'),
  343.         MUIA_Window_NoMenus, TRUE,
  344.         WindowContents, gr_prefs,
  345.     End;
  346.  
  347.  
  348.     // WINDOW INFO
  349.  
  350.     Object->win_info = WindowObject,
  351.         MUIA_Window_Title, GetMBString(m_win_info),
  352.         MUIA_Window_ID, MAKE_ID('3', 'W', 'I', 'N'),
  353.         MUIA_Window_CloseGadget, FALSE,
  354.         MUIA_Window_NoMenus, TRUE,
  355.         WindowContents, GroupObject,
  356.             Child, HGroup,
  357.                 MUIA_Background, MUII_GroupBack,
  358.                 MUIA_Frame, MUIV_Frame_Group,
  359.                 Child, VGroup,
  360.                     Child, ImageObject,
  361.                         MUIA_Background, MUII_GroupBack,
  362.                         MUIA_Image_Spec, "5:MUISpell.brush",
  363.                         MUIA_FramePhantomHoriz, TRUE,
  364.                         MUIA_Frame, MUIV_Frame_ImageButton,
  365.                         MUIA_Image_FreeVert, TRUE,
  366.                         MUIA_Image_FreeHoriz, TRUE,
  367.                         MUIA_FixWidth, 97,
  368.                         MUIA_FixHeight, 103,
  369.                         End,
  370.                     Child, VSpace(0),
  371.                     End,
  372.                 Child, ListviewObject,
  373.                     MUIA_Weight, 250,
  374.                     MUIA_Listview_Input, FALSE,
  375.                     MUIA_Listview_List, FloattextObject,
  376.                         MUIA_Background, MUII_GroupBack,
  377.                         MUIA_List_Format, "P=\33c",
  378.                         MUIA_Floattext_Text, GetMBString(m_tx_info),
  379.                         End,
  380.                     End,
  381.                 End,
  382.             Child, Object->bt_info = SimpleButton(GetMBString(m_bt_info)),
  383.             End,
  384.         End;
  385.  
  386.  
  387.     // MENU
  388.     
  389.     Object->men_spell = MenustripObject,
  390.         MUIA_Family_Child,         MNlabel0Projekt = MenuitemObject,
  391.             MUIA_Menuitem_Title, GetMBString(m_MNlabel0Projekt),
  392.             MUIA_Family_Child, MNlabel0Laden = MenuitemObject,
  393.                 MUIA_Menuitem_Title, GetMBString(m_MNlabel0Laden),
  394.                 MUIA_Menuitem_Shortcut, GetMBString(m_MNlabel0LadenChar),
  395.                 End,
  396.             Barlabel,
  397.             MUIA_Family_Child, MNlabel0Speichern = MenuitemObject,
  398.                 MUIA_Menuitem_Title, GetMBString(m_MNlabel0Speichern),
  399.                 MUIA_Menuitem_Shortcut, GetMBString(m_MNlabel0SpeichernChar),
  400.                 End,
  401.             MUIA_Family_Child, MNlabel0Speichernals = MenuitemObject,
  402.                 MUIA_Menuitem_Title, GetMBString(m_MNlabel0Speichernals),
  403.                 MUIA_Menuitem_Shortcut, GetMBString(m_MNlabel0SpeichernalsChar),
  404.                 End,
  405.             Barlabel,
  406.             MUIA_Family_Child, MNlabel0Voreinstellungen = MenuitemObject,
  407.                 MUIA_Menuitem_Title, GetMBString(m_MNlabel0Voreinstellungen),
  408.                 MUIA_Menuitem_Shortcut, GetMBString(m_pref),
  409.                 End,
  410.             Barlabel,
  411.             MUIA_Family_Child, menspellHilfe = MenuitemObject,
  412.                 MUIA_Menuitem_Title, GetMBString(m_menspellHilfe),
  413.                 End,
  414.             MUIA_Family_Child, MNlabel0Info = MenuitemObject,
  415.                 MUIA_Menuitem_Title, GetMBString(m_MNlabel0Info),
  416.                 End,
  417.             Barlabel,
  418.             MUIA_Family_Child, MNlabel0Ende = MenuitemObject,
  419.                 MUIA_Menuitem_Title, GetMBString(m_MNlabel0Ende),
  420.                 MUIA_Menuitem_Shortcut, GetMBString(m_MNlabel0EndeChar),
  421.                 End,
  422.             End,
  423.         End;
  424.  
  425.     // APPLICATION
  426.  
  427.     Object->App = ApplicationObject,
  428.         MUIA_Application_Author, "Dirk Holtwick",
  429.         MUIA_Application_Menustrip, Object->men_spell,
  430.         MUIA_Application_Base, "MUISPELL",
  431.         MUIA_Application_Title, "MUISpell",
  432.         MUIA_Application_Version, "$VER: MUISpell 1.1 [" __DATE__ "]",
  433.         MUIA_Application_Copyright, "© Dirk Holtwick 1995/1996",
  434.         MUIA_Application_Description, GetMBString(m_AppDescription),
  435.         MUIA_Application_HelpFile, GetMBString(m_guide),
  436.         MUIA_HelpNode, "Main",
  437.         SubWindow, Object->win_view,
  438.         SubWindow, Object->win_prefs,
  439.         SubWindow, Object->win_info,
  440.         End;
  441.  
  442.     if (!Object->App){
  443.         FreeVec(Object);
  444.         return(NULL);
  445.     }
  446.  
  447.     // METHODS
  448.     DoMethod(MNlabel0Laden,MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
  449.         MNlabel0Laden,2,MUIM_CallHook, &do_loadHook);
  450.     DoMethod(MNlabel0Speichern,MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
  451.         MNlabel0Speichern,2,    MUIM_CallHook, &do_saveHook);
  452.     DoMethod(MNlabel0Speichernals,MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
  453.         MNlabel0Speichernals,2,    MUIM_CallHook, &do_saveasHook);
  454.     DoMethod(MNlabel0Voreinstellungen,MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
  455.         Object->win_prefs,3,MUIM_Set, MUIA_Window_Open, TRUE);
  456.     DoMethod(menspellHilfe,    MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
  457.         Object->App,5,MUIM_Application_ShowHelp,0,GetMBString(m_guide),"Main",0);
  458.     DoMethod(MNlabel0Info,MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
  459.         Object->win_info,3,MUIM_Set, MUIA_Window_Open, TRUE);
  460.     DoMethod(MNlabel0Ende,MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
  461.         Object->App,2,MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  462.     DoMethod(Object->lv_spell,MUIM_Notify, MUIA_Listview_DoubleClick, TRUE,
  463.         Object->lv_spell,2,MUIM_CallHook, &do_lvacceptHook    );
  464.     DoMethod(Object->bt_learn,    MUIM_Notify, MUIA_Pressed, FALSE,
  465.         Object->bt_learn,2,MUIM_CallHook, &do_learnHook);
  466.     DoMethod(Object->bt_guess,MUIM_Notify, MUIA_Pressed, FALSE,
  467.         Object->bt_guess,2,MUIM_CallHook, &do_guessHook);
  468.     DoMethod(Object->cy_line,MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime,
  469.         Object->cy_line,2,MUIM_CallHook, &do_lineHook);
  470.     DoMethod(Object->bt_accept,MUIM_Notify, MUIA_Pressed, FALSE,
  471.         Object->bt_accept,2,MUIM_CallHook, &do_acceptHook);
  472.     DoMethod(Object->bt_ignore,MUIM_Notify, MUIA_Pressed, FALSE,
  473.         Object->bt_ignore,2,MUIM_CallHook, &do_ignoreHook);
  474.     DoMethod(Object->bt_tskip,MUIM_Notify, MUIA_Pressed, FALSE,
  475.         Object->bt_tskip,2,MUIM_CallHook, &do_goonHook);
  476.     DoMethod(Object->bt_tback,MUIM_Notify, MUIA_Pressed, FALSE,
  477.         Object->bt_tback,2,MUIM_CallHook, &do_backHook);
  478.     DoMethod(Object->win_view,MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
  479.         Object->App,2,MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  480.     DoMethod(Object->win_view,MUIM_Window_SetCycleChain, 
  481.         Object->lv_view,0);
  482.     DoMethod(Object->win_prefs,MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
  483.         Object->win_prefs,3,MUIM_Set, MUIA_Window_Open, FALSE);
  484.     DoMethod(Object->bt_save_prefs,MUIM_Notify, MUIA_Pressed, FALSE,
  485.         Object->bt_save_prefs,2,MUIM_CallHook, &do_save_prefsHook);
  486.     DoMethod(Object->bt_use_prefs,MUIM_Notify, MUIA_Pressed, FALSE,
  487.         Object->bt_use_prefs,2,MUIM_CallHook, &do_use_prefsHook);
  488.     DoMethod(Object->bt_cancel_prefs,MUIM_Notify, MUIA_Pressed, FALSE,
  489.         Object->bt_cancel_prefs,2,MUIM_CallHook, &do_cancel_prefsHook);
  490.     DoMethod(Object->str_keyfile,MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
  491.         Object->str_keyfile,2,MUIM_CallHook, &do_editdistHook);
  492.     DoMethod(Object->str_drawer,MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
  493.         Object->str_drawer,2,MUIM_CallHook, &do_drawerHook);
  494.     DoMethod(Object->str_spell, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
  495.         Object->str_spell,2,MUIM_CallHook, &do_acceptHook);
  496.     DoMethod(Object->bt_info,MUIM_Notify, MUIA_Pressed, FALSE,
  497.         Object->win_info,3,MUIM_Set, MUIA_Window_Open, FALSE);
  498.     DoMethod(Object->win_info,MUIM_Window_SetCycleChain, 
  499.         Object->bt_info,0);
  500.     DoMethod(Object->win_prefs,
  501.         MUIM_Window_SetCycleChain, Object->cy_ram,
  502.         Object->sl_back,
  503.         Object->sl_forward,
  504.         Object->sl_buffer,
  505.         Object->pa_drawer,
  506.         Object->pa_books,
  507.         Object->str_user,
  508.         Object->pa_keyfile,
  509.         Object->sl_rate,
  510.         Object->bt_save_prefs,
  511.         Object->bt_use_prefs,
  512.         Object->bt_cancel_prefs,
  513.         0);
  514.     DoMethod(Object->win_view,
  515.         MUIM_Window_SetCycleChain,
  516.         Object->bt_tback,
  517.         Object->pa_spell,
  518.         Object->bt_tskip,
  519.         Object->lv_view,
  520.         Object->bt_learn,
  521.         Object->bt_guess,
  522.         Object->cy_line,
  523.         Object->bt_accept,
  524.         Object->bt_ignore,
  525.         0);
  526.  
  527.     set(Object->win_view, MUIA_Window_Open, TRUE);
  528.  
  529.     return(Object);
  530. }
  531.  
  532. void DisposeApp(struct ObjApp * Object)
  533. {
  534.     MUI_DisposeObject(Object->App);
  535.     FreeVec(Object);
  536. }
  537.